package com.eaoa.uc.bustransfer.action;

import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.eaoa.base.EABaseAction;
import com.eaoa.query.bus.BusTransferQuery;
import com.eaoa.uc.bustransfer.bo.BusTransferAlterOrdersBO;
import com.eaoa.vo.bus.BusTransfer;
import com.stony.core.util.CoreUtils;

public class BusTransferRemoveOrderAction extends EABaseAction {

	protected ActionForward doWork(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		Long transferno = CoreUtils.parseLong(request.getParameter("transferno"));
		Long orderno = CoreUtils.parseLong(request.getParameter("orderno"));
		
		new BusTransferAlterOrdersBO(transferno, orderno, BusTransferAlterOrdersBO.OPER_REMOVE).execute();
		
		BusTransfer transfer = BusTransferQuery.loadByNOInitPubOrders(transferno);
		
		request.setAttribute("result", transfer);
		
		return mapping.findForward("success");
	}
}